package edu.hubu.robots;

import edu.hubu.robots.man.entity;
import edu.hubu.robots.sv.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class controller {

    @Autowired
    private service robotservice;


    @RequestMapping("/robot/add")
    public vo add(entity entity){
        return robotservice.addRobot(entity);
    }
    @RequestMapping("/robot/delete")
    public vo delete(int id){
        return robotservice.removeRobot(id);

    }
    @RequestMapping("/robot/update")
    public vo update(int id,String xinghao,int number,String remark){
        return robotservice.updateRobot(id,xinghao,number,remark);
    }
    @RequestMapping("/robot/select")
    public vo select(String xinghao){
        return robotservice.selectRobot(xinghao);
    }
    @RequestMapping("/robot/selects")
    public vo selects(){
        return robotservice.listRobot();
    }
}